<app-delete-alert [(opened)]="showDelete" [resourceTypeName]="resourceTypeName" [items]="selected"
                  (confirm)="delete()">

</app-delete-alert>
<clr-datagrid [clrDgLoading]="loading" [clrDgSelected]="selected">
  <clr-dg-action-bar>
    <div class="btn-group">
      <button type="button" class="btn btn-sm btn-secondary" (click)="addItem()">
        <clr-icon shape="plus" size="16" ></clr-icon>
        添加
      </button>
      <button type="button" class="btn btn-sm btn-secondary"
              [disabled]="selected.length == 0"
              (click)="showDelete=true" >
        <clr-icon shape="close"></clr-icon>
        删除
      </button>
    </div>
  </clr-dg-action-bar>
  <clr-dg-column>名称</clr-dg-column>
  <clr-dg-column>类型</clr-dg-column>
  <clr-dg-column>桶/容器</clr-dg-column>
<!--  <clr-dg-column>区域</clr-dg-column>-->
  <clr-dg-column>状态</clr-dg-column>
  <clr-dg-column>创建时间</clr-dg-column>
<!--  <clr-dg-column>操作</clr-dg-column>-->

  <clr-dg-row *clrDgItems="let item of items" [clrDgItem]="item">
    <clr-dg-cell>{{item.name}}</clr-dg-cell>
    <clr-dg-cell>{{item.type}}</clr-dg-cell>
    <clr-dg-cell>{{getBucket(item)}}</clr-dg-cell>
<!--    <clr-dg-cell>{{item.region}}</clr-dg-cell>-->
    <clr-dg-cell [ngStyle]="{'color':item.status==='VALID'?'green':'red'}">{{item.status | backupStorageStatus}}</clr-dg-cell>
    <clr-dg-cell>{{item.date_created | date: 'yyyy-MM-dd HH:mm:ss'}}</clr-dg-cell>
<!--    <clr-dg-cell></clr-dg-cell>-->

  </clr-dg-row>

  <clr-dg-footer>

  </clr-dg-footer>

</clr-datagrid>
